<%@ Page Language="C#" MasterPageFile="~/MasterPageMcSigAdmin.master" AutoEventWireup="true" CodeFile="CofinanciacionListado.aspx.cs" Inherits="CofinanciacionListado" Title="Untitled Page" %>
<%@ Register Assembly="FUA" Namespace="Subgurim.Controles" TagPrefix="cc2" %>

<%@ Register Assembly="UsrControls" Namespace="UsrControls" TagPrefix="cc1" %>
<%@ Register Assembly="Anthem" Namespace="Anthem" TagPrefix="anthem" %>   
<%@ Register Assembly="DevExpress.Web.v12.2, Version=12.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dxe" %>
<%@ Register Assembly="DevExpress.Web.v12.2, Version=12.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dxwgv" %>
<%@ Register assembly="DevExpress.Web.v12.2, Version=12.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxGridView.Export" tagprefix="dx" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<script language="javascript" type="text/javascript">
    function OnGridSelectionChanged() {
    var counter = document.getElementById("selCount");
    if(counter != null) 
    setInnerText(counter, ctl00_ContentPlaceHolder1_gridEjecucion.GetSelectedRowCount().toString());
    ctl00_ContentPlaceHolder1_gridEjecucion.GetSelectedFieldValues('FPR_ENTIDAD_TERRITORIAL_COFINANCION', OnGridSelectionComplete);
}
function OnGridSelectionComplete(values) {
    selList.BeginUpdate();
    selList.ClearItems();
    for(var i = 0; i < values.length; i ++) {
        selList.AddItem(values[i]);
    }
    selList.EndUpdate();
}
function setInnerText(element, text) { 
    if(typeof element.textContent != 'undefined') { 
        element.textContent = text; 
    } 
    else if (typeof element.innerText != 'undefined') { 
        element.innerText = text; 
    } 
    else if (typeof element.removeChild != 'undefined') { 
        while (element.hasChildNodes()) { 
            element.removeChild(element.lastChild); 
        } 
        element.appendChild(document.createTextNode(text)); 
    } 
}

function confirmEdit()
{
var counter = ctl00_ContentPlaceHolder1_gridEjecucion.GetSelectedRowCount();

if (counter > 1)
    {
    counter = 0;
        alert("Debe seleccionar un solo registro");
        return(false);
    }
    else if (counter == 1)
    {
    counter = 0;
        return(true);
    }
    else if (counter == 0)
    {
    counter = 0;
    alert("Debe seleccionar al  menos un registro");
        return(false);
    }
}
function delete_PreCallBack(button) 
{
var counter = ctl00_ContentPlaceHolder1_gridEjecucion.GetSelectedRowCount();

if (counter > 0)
    {
        return confirm ('Esta seguro de eliminar los registros seleccionados?')
    }
  alert("Debe seleccionar por lo menos un registro");
    return(false);
  
}

function confirmDelete () 
{ 
		var frm;
		
		if (arguments.length > 0)
		{
			frm = arguments[0];
		}
		else
		{
			frm =document.forms[0];
		}



    // loop through all elements
    for (i=0; i<frm.length; i++) 
    {
        // Look for our checkboxes only
        if (frm.elements[i].name.indexOf("chkId") !=-1) 
        {
            // If any are checked then confirm alert, otherwise nothing happens
            if(frm.elements[i].checked) 
            {
                return confirm ('Esta seguro de eliminar los registros seleccionados?')
            }
        }
    }
    alert("Debe seleccionar por lo menos un registro");
    return(false);
}
    </script>
 <h1 class="planes">Planes y Programas</h1>
    
                <anthem:Label ID="lblMensaje" runat="server" AutoUpdateAfterCallBack="True" UpdateAfterCallBack="True"></anthem:Label>
                <anthem:TextBox ID="txtidUsuario" runat="server" AutoUpdateAfterCallBack="True" Visible="False">8</anthem:TextBox>
       <cc1:WccAcciones ID="WccAcciones1"  CssClass="toolbar" runat="server" AddCausesValidation="False" AddEnableCallBack="False"
                    ArchiveVisible="False" AuditVisible="False" DeclineVisible="False" DeleteEnableCallBack="True"
                    DeletePreCallBackFunction="delete_PreCallBack" OnAdd_OnClick="WccAcciones1_Add_OnClick"
                    OnDelete_OnClick="WccAcciones1_Delete_OnClick" OnUpdate_OnClick="WccAcciones1_Update_OnClick"
                    PublishVisible="False" UpdateCausesValidation="False" UpdateEnableCallBack="False"
                    UpdateOnClickFunction="return confirmEdit();" ValidateVisible="False" />
                <table class="tabs">
                    <tr>
                        <td class="tab-inactivo">
                            <anthem:LinkButton ID="lnkPlanPrograma" runat="server" CausesValidation="False" EnableCallBack="False"
                                OnClick="lnkPlanPrograma_Click">Plan Programa</anthem:LinkButton></td>
                        <td id="td2" runat="server" class="tab-inactivo" visible="true">
                            <anthem:LinkButton ID="lnkEjecucion" runat="server" CausesValidation="False" EnableCallBack="False"
                                OnClick="lnkEjecucion_Click">EJECUCION</anthem:LinkButton></td>
                        <td id="td3" runat="server" class="tab-activo" visible="true">
                            <anthem:LinkButton ID="LnkFormacionAcademica" runat="server" CausesValidation="False"
                                EnableCallBack="False" Enabled="False">COFINANCIACION</anthem:LinkButton></td>
                        <td id="td4" runat="server" class="tab-inactivo" visible="false">
                            <anthem:LinkButton ID="lnkPublicacionesRelevantes" runat="server" CausesValidation="False"
                                EnableCallBack="False" Enabled="true">Otros</anthem:LinkButton></td>
                    </tr>
                </table>
                
           
                <anthem:Panel ID="Panel1" runat="server" AutoUpdateAfterCallBack="True" Width="100%">
                <div class="overflow">
                    <dxwgv:ASPxGridView ID="gridEjecucion" runat="server" AutoGenerateColumns="False"
                        CssFilePath="~/App_Themes/Plastic Blue/{0}/styles.css" CssPostfix="PlasticBlue"
                        KeyFieldName="FPR_ID" Width="100%" Theme="PlasticBlue">
                       
                        <Settings ShowFilterRow="True" ShowFilterRowMenu="True" />
                        <Styles CssFilePath="~/App_Themes/Plastic Blue/{0}/styles.css" CssPostfix="PlasticBlue">
                            <Header ImageSpacing="10px" SortingImageSpacing="10px">
                            </Header>
                        </Styles>
                        
                        <Columns>
                            <dxwgv:GridViewCommandColumn ShowSelectCheckbox="True" VisibleIndex="0">
                                <ClearFilterButton Visible="True">
                                </ClearFilterButton>
                            </dxwgv:GridViewCommandColumn>
                            <dxwgv:GridViewDataTextColumn Caption="Entidad Territorial Cofinanciaci&#243;n" FieldName="FPR_ENTIDAD_TERRITORIAL_COFINANCION"
                                VisibleIndex="1" Width="100px">
                            </dxwgv:GridViewDataTextColumn>
                            <dxwgv:GridViewDataTextColumn Caption="Entidad Territorial Cofinanciaci&#243;n Valor"
                                FieldName="FPR_ENTIDAD_TERRITORIAL_COFINANCION_VALOR" VisibleIndex="2" Width="100px">
                            </dxwgv:GridViewDataTextColumn>
                            <dxwgv:GridViewDataTextColumn Caption="Entidad Cooperaci&#243;n Internacional Pais"
                                FieldName="FPR_ENTIDAD_COOPINTERNACIONAL_PAIS" VisibleIndex="3" Width="100px">
                                <PropertiesTextEdit DisplayFormatString="{0:N0}">
                                </PropertiesTextEdit>
                            </dxwgv:GridViewDataTextColumn>
                            <dxwgv:GridViewDataTextColumn Caption="Entidada Coop Internacional Cofinanciaci&#243;n Pais"
                                FieldName="FPR_ENTIDAD_COOPINTERNACIONAL_COFINANCION_VALOR" VisibleIndex="4"
                                Width="100px">
                                <PropertiesTextEdit DisplayFormatString="{0:N2}">
                                </PropertiesTextEdit>
                            </dxwgv:GridViewDataTextColumn>
                            <dxwgv:GridViewDataTextColumn Caption="Entidad Otra Cofinanciaci&#243;n" FieldName="FPR_ENTIDAD_OTRA_COFINANCION"
                                VisibleIndex="5" Width="100px">
                            </dxwgv:GridViewDataTextColumn>
                            <dxwgv:GridViewDataTextColumn Caption="Entidad Otra Cofinanciaci&#243;n  Valor" FieldName="FPR_ENTIDAD_OTRA_COFINANCION_VALOR"
                                VisibleIndex="6" Width="100px">
                            </dxwgv:GridViewDataTextColumn>
                            <dxwgv:GridViewDataTextColumn Caption="Entidad Cooperaci&#243;n Internacional Cofinanciaci&#243;n"
                                FieldName="FPR_ENTIDAD_COOPINTERNACIONAL_COFINANCION" VisibleIndex="7" Width="100px">
                            </dxwgv:GridViewDataTextColumn>
                        </Columns>
                        <SettingsPager ShowDefaultImages="False">
                            <AllButton Text="Todos" ImagePosition="Top">
                            </AllButton>
                            <NextPageButton Text="Siguiente &gt;">
                            </NextPageButton>
                            <PrevPageButton Text="&lt; Anterior">
                            </PrevPageButton>
                        </SettingsPager>
                    </dxwgv:ASPxGridView>
                    </div>
                    </anthem:Panel>
                    
             
</asp:Content>

